package com.ruoyi.project.domain.dto;

import java.util.Date;
import cn.hutool.core.bean.BeanUtil;
import com.ruoyi.project.domain.entity.Customer;

import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.EqualsAndHashCode;
import lombok.NoArgsConstructor;

/**
 * 客户基本信息表(Customer)表DTO层
 *
 * @author makejava
 * @since 2025-06-30 23:52:17
 */
@Data
@NoArgsConstructor
@AllArgsConstructor
@EqualsAndHashCode(callSuper = true)
public class CustomerDTO extends Customer {

    private static final long serialVersionUID = 1L;

    private String keyword;

    public boolean isNew() {
        return this.getId() == null;
    }

    public static CustomerDTO of(Customer data) {
        CustomerDTO dto = new CustomerDTO();
        BeanUtil.copyProperties(data, dto);
        return dto;
    }
}
